class WindowManager {
  constructor() {
    this.winIds = new Map();
  }
  add(key, value) {
    this.winIds.set(key, value);
  }
  has(key) {
    return this.winIds.has(key);
  }
  update(key, value) {
    if (this.winIds.has(key)) {
      this.winIds.delete(key);
    }
    this.add(key, value);
  }
  delete(key) {
    this.winIds.delete(key);
  }
  get(key) {
    if (this.has(key)) {
      return this.winIds.get(key);
    } else {
      return null;
    }
  }
}

module.exports = new WindowManager();
